package com.bw.mvvm.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import com.bw.mvvm.BaseApplication;

//判断网络是否连接
public class ISConnectUtiles {
    public static boolean isConnect(){
        ConnectivityManager manager = (ConnectivityManager) BaseApplication.getInstance().getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = manager.getActiveNetworkInfo();
        if (info == null)
            return false;
        return info.isConnected();
    }
}
